import Layouts from '@/components/Layout';
import { Button, Result } from 'antd';
import React from 'react';
import { history, useLocation } from 'umi';
const SuccessPage: React.FC = () => {
  const location = useLocation();
  const handleClickGoOn = (num: number) => {
    if (num === 1) {
      history.push('/hold');
    } else {
      if (location['query'].form === 'act') {
        history.push('/things-to-do');
      } else {
        history.push('/tours');
      }
    }
  };
  return (
    <Layouts>
      <Result
        status="success"
        title="发布成功!"
        subTitle="赶紧去看看吧"
        extra={[
          <Button onClick={() => handleClickGoOn(1)}>继续发布</Button>,
          <Button key="buy" onClick={() => handleClickGoOn(2)} type="primary">
            去看看
          </Button>,
        ]}
      />
    </Layouts>
  );
};

export default SuccessPage;
